#include<bits/stdc++.h>
#define iterator map<int,int>::iterator
using namespace std;
int n,arr;
map<int,int> mp;
int died;
int notdied=0;
int main()
{
	freopen("duel.in","r",stdin);
	freopen("duel.out","w",stdout);
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		cin>>arr;
		mp[arr]++;
	}
	iterator i=mp.begin(),j=mp.begin();
	i++;
	for(;i!=mp.end();i++,j++)
	{
		if((*j).second>(*i).second)
		{
			notdied+=(*j).second-(*i).second;
		}
		died+=min((*j).second,(*i).second+notdied);
		if((*i).second>(*j).second)
		{
			notdied=max(0,notdied-((*i).second-(*j).second));
		}
	}
	cout<<notdied+(*j).second;
	return 0;
}
